/**
 * @PurchaseAction.as
 * @Author - Dheeraj Singh
 * @Version - 1.0
 * @Date - March 25, 2013
 * 
 * Copyright (c) 2013 EdRP, Dayalbagh Educational Institute.
 * All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or
 * without modification, are permitted provided that the following
 * conditions are met:
 *
 * Redistributions of source code must retain the above copyright
 * notice, this  list of conditions and the following disclaimer.
 *
 * Redistribution in binary form must reproducuce the above copyright
 * notice, this list of conditions and the following disclaimer in
 * the documentation and/or other materials provided with the
 * distribution.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL ETRG OR ITS CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
 * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
 * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Contributors: Members of EdRP, Dayalbagh Educational Institute
 */

import AssetClass.AssetClass;

import accountingCalendar.AccountingCalendar;

import accountingOptions.AccountingSetups;

import accounts.accountsInformation.AccountsInformation;
import accounts.groupAccounts.GroupAccounts;

import assetRegister.assetRegister;

import definingCurrency.definingCurrencies;

import flexFieldSettings.FlexFieldSettings;
import flexFieldSettings.keyFlexFieldSegments.keyFlexFieldSegments;

import menuNavigator.MenuNavigator;

import mx.controls.Alert;
import mx.events.MenuEvent;

import rollUpGroup.RollUpGroup;

import segmentValues.SegmentValues;

import summaryAccount.SummaryAccountTemplate;

private function menuHandler(event:MenuEvent):void  {
	var menuId:String=event.item.@menuId;					
	firstView(menuId);				
}

protected function firstView(menuId:String):void{
	switch(menuId)
	{
		case "MAAA":
		{
			var groupAccounts:GroupAccounts = new GroupAccounts();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(groupAccounts);
			break;
		}
			
		case "MAAB":
		{
			var accountInformation:AccountsInformation = new AccountsInformation();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(accountInformation);
			break;
		}
			
		case "MAB":
		{
			var keyFlexFieldSettings:keyFlexFieldSegments = new keyFlexFieldSegments();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(keyFlexFieldSettings);
			break;
		}
			
		case "MAC":
		{
			var segmentValues:SegmentValues = new SegmentValues();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(segmentValues);
			break;
		}
		
		case "MBA":
		{
			var assetregister:assetRegister = new assetRegister();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(assetregister);
			break;
		}
		case "MCAA":
		{
			var summaryAccTemplate:SummaryAccountTemplate= new SummaryAccountTemplate();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(summaryAccTemplate);
			break;
		}
			
		case "MCBAA":
		{
			var accSetup:AccountingSetups= new AccountingSetups();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(accSetup);
			break;
		}
			
		case "MAD":
		{
			var accCal:AccountingCalendar= new AccountingCalendar();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(accCal);
			break;
		}
			
		case "MBB":
		{
			var mnu : MenuNavigator = new MenuNavigator();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(mnu);
			break;
		}
			
		case "MBC":
		{
			var rollUpGroup:RollUpGroup= new RollUpGroup();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(rollUpGroup);
			break;
		}
			
		case "MBD":
		{
			var defcu:definingCurrencies= new definingCurrencies();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(defcu);
			break;
		}
			
		case "MBE":
		{
			var assclass:AssetClass = new AssetClass();
			screensCanvas.removeAllChildren();
			screensCanvas.addChild(assclass);
			break;
		}
		default:
		{
			break;
		}
	}
}